package com.bajiao.entity.product;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import com.bajiao.common.aspect.annotation.Dict;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;

/**
 * @Description: 产品表
 * @Author: FanJq
 * @Date:   2024-12-13
 * @Version: V1.0
 */
@Data
@TableName("tb_product")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="tb_product对象", description="产品表")
public class Product {

	/**主键*/
	@TableId(type = IdType.ID_WORKER_STR)
    @ApiModelProperty(value = "主键", required = true, position = 0)
	private String id;

    @ApiModelProperty(value = "店铺id", required = true, position = 10)
	@Dict(dictTable ="tb_store",dicText = "title",dicCode = "id")
	@Excel(name = "店铺名称", width = 15, dictTable = "tb_store",dicCode = "id",dicText = "title")
	private String storeId;

	@Excel(name = "商品名称", width = 20)
    @ApiModelProperty(value = "标题", required = true, position = 20)
	private String title;

    @ApiModelProperty(value = "封面", required = true, position = 30)
	private String cover;

    @ApiModelProperty(value = "产品轮播图", required = true, position = 40)
	private String sliderImage;

	@Excel(name = "单价", width = 15)
    @ApiModelProperty(value = "单价", required = true, position = 50)
	private BigDecimal price;

	@Excel(name = "产品介绍", width = 50)
    @ApiModelProperty(value = "产品介绍", required = true, position = 60)
	private String intro;

	@Excel(name = "销量", width = 15)
    @ApiModelProperty(value = "销量", required = true, position = 70)
	private Integer sales;

	@Excel(name = "浏览量", width = 15)
    @ApiModelProperty(value = "浏览量", required = true, position = 80)
	private Integer browse;

	@Excel(name = "状态", width = 15, replace={"下架_0","上架_1"})
    @ApiModelProperty(value = "0-下架 1-上架", required = true, position = 90)
	private Integer status;

	@Excel(name = "发布时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间", required = true, position = 100)
	private Date createTime;

	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新时间", required = true, position = 110)
	private Date updateTime;

	@TableLogic
	@ApiModelProperty(value = "删除标识 0-否 1-是", required = true, position = 110)
	private Integer delFlag;

	@ApiModelProperty("分类id")
	@Dict(dictTable ="tb_classify",dicText = "title",dicCode = "id")
	private String classifyId;
}
